package net.akkz.action.feature;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.akkz.beanFactory.BeanFactory;
import net.akkz.model.Student;
import net.akkz.server.FultureServer;

public class FultureOwnFind extends HttpServlet
{
	private FultureServer fultureServer;
	
	@Override
	protected void doPost(HttpServletRequest request, HttpServletResponse response)  throws IOException,ServletException
	{
		int studentId = ((Student)request.getAttribute("student")).getId();
		request.setAttribute("myFultures", fultureServer.findFultureByStudentId(studentId));
	}
	
	@Override
	public void init()
	{
		BeanFactory  bf = (BeanFactory) this.getServletContext().getAttribute("beanFactory");
		
		fultureServer = bf.getBean("fultureServer");
	}

}
